#希尔排序
lii = [174, 321, 399, 92, 566, 153, 226, 816, 856, 136]
def insert_sort_gap(li,gap):
    for i in range(gap,len(li)):#i表示摸的牌下标
        j = i - gap #j表示手上牌的下标
        temp = li[i]
        while j >= 0 and li[j] > temp:
            li[j+gap] = li[j]
            j -= gap
        li[j+gap] = temp

def shell_sort(li):
    d = len(li) // 2
    while d >= 1:
        insert_sort_gap(li,d)
        d //= 2

shell_sort(lii)
print(lii)